class Animal{
    constructor(name){
        this.name = name;
    }
    run(){
        console.log(`${this.name} is running`)
    }
}

// let dog = new Animal('Animal')
// dog.run();

class Dog extends Animal{
    constructor(name){
        super(name);
    }
}

// let nDog = new Dog('nDog')
// nDog.run();


class Cat extends Animal{
    constructor(name){
        super(name)
        console.log(name)
    }
    run(){
        this.name = 'Cat'
        super.run();
    }
}

let cat = new Cat('nn');
cat.run();
